package com.molihub.service.impl;

import com.molihub.entity.User;
import com.molihub.service.UserService;
import com.molihub.utils.LogUtils;
import org.slf4j.Logger;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends BaseService implements UserService {

    Logger logger = LogUtils.getInstance(UserServiceImpl.class);

    @Override
    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public List<User> getUsersByIdList(List<Integer> list) {
        return userMapper.getUsersByIdList(list);
    }

    @Override
    public User getUserByOpenId(String openId) {
        return userMapper.getUserByOpenId(openId);
    }

    @Override
    public User getUserByUserNameAndPassword(String userName, String password) {
        return userMapper.getUserByUserNameAndPassword(userName,password);
    }

    @Override
    public User getUserByEmail(String email) {
        return userMapper.getUserByEmail(email);
    }

    @Override
    public User getUserByFileStoreId(Integer fileStoreId) {
        return userMapper.getUserByFileStoreId(fileStoreId);
    }

    @Override
    public Integer updateUser(User user) {
        return userMapper.updateUser(user);
    }

    @Override
    public User getUserByUserName(String userName) {
        return userMapper.getUserByUserName(userName);
    }

    @Override
    public Integer updateUserStatus(User user) {
        return userMapper.updateUserStatus(user);
    }
}
